package com.liu.oa.employee.service.impl;

import java.util.List;

import org.apache.ibatis.session.RowBounds;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.liu.oa.employee.dao.EmployeeDao;
import com.liu.oa.employee.entity.EmployeeEntity;
import com.liu.oa.employee.service.EmployeeService;

@Service
public class EmployeeServiceImpl implements EmployeeService {

	
	@Autowired
	private EmployeeDao dao;
	
	@Override
	public int insert(EmployeeEntity entity){
		
		int i = dao.insert(entity);
		return i;
	}

	@Override
	public List<EmployeeEntity> myfindAll() {
		List<EmployeeEntity> myfindAll=null;
		try {
			myfindAll = dao.myfindAll();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return myfindAll;
	}

	@Override
	public List<EmployeeEntity> myfindpage() {
		
		List<EmployeeEntity> list=dao.selectByExampleAndRowBounds(null, new RowBounds(1,2));
		
		return list;
	}

}
